package com.pe.pgn.clubpgn.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableId;
import org.hibernate.annotations.Type;

/**
 * @author Frank Ayala
 * */

@Entity
@Table(name = "clpd_meta")
@Searchable
public class ClpdMeta extends CamposAuditoria{


	private static final long serialVersionUID = -5124798602654156219L;
	private Double vaCosto;
	private Double vaMeta;
	private String deMeta;
	private boolean stMeta;
	private Long id;
	private ClpbPrograma clpbPrograma = new ClpbPrograma();	
	
	@Override
	public boolean equals(Object o) {
		return false;
	}
	@Override
	public int hashCode() {
		return 0;
	}
	@Override
	public String toString() {
		return this.deMeta;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE)
	@SearchableId	
	public Long getId() {
		return id;
	}
	
	@Column(name = "va_costo", nullable = false)
	public Double getVaCosto() {
		return vaCosto;
	}
	public void setVaCosto(Double vaCosto) {
		this.vaCosto = vaCosto;
	}
	
	@Column(name = "va_meta", nullable = false)
	public Double getVaMeta() {
		return vaMeta;
	}
	public void setVaMeta(Double vaMeta) {
		this.vaMeta = vaMeta;
	}
	
	@Column(name = "de_meta", nullable = false)
	public String getDeMeta() {
		return deMeta;
	}
	public void setDeMeta(String deMeta) {
		this.deMeta = deMeta;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "st_meta", nullable = false)
	@Type(type = "yes_no") 
	public boolean isStMeta() {
		return stMeta;
	}
	public void setStMeta(boolean stMeta) {
		this.stMeta = stMeta;
	}
	
	@ManyToOne(targetEntity = ClpbPrograma.class)
    @JoinColumn(name = "clpb_programa")
	public ClpbPrograma getClpbPrograma() {
		return clpbPrograma;
	}
	public void setClpbPrograma(ClpbPrograma clpbPrograma) {
		this.clpbPrograma = clpbPrograma;
	}
	
}
